<template>
  <div>
    <p v-if='isReadOnlyPage === true'>{{strValue}}</p>
    <a-checkbox v-else :checked="convertedValue" @change="onchange" />
  </div>
</template>
<script>
export default {
  name: 'Checkbox',
  model: {
    prop: 'value',
    event: 'change'
  },
  props: ['value', 'isReadOnlyPage', 'title'],
  computed: {
    convertedValue () {
      if (this.value === 'Y') {
        return true
      } else {
        return false
      }
    }
  },
  methods: {
    onchange (e) {
      this.$emit('change', e.starget.value)
    }
  }
}
</script>
<style lang="stylus" scoped>
</style>
